<include file="Public/header"/>

<div class="x-nav">
      <span class="layui-breadcrumb">

      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so">
           <div class="layui-input-inline">
            <select name="quyu_id">
              <option value="0">线路分类</option>
              <foreach name="info" item="v">
              	<option value="{$v.id}" >{$v.name}</option>
              </foreach>
            </select>
          </div>
          <input type="text" name="name"  placeholder="请输入小区名称" autocomplete="off" value="{:I('name')}" class="layui-input">
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
            <button class="layui-btn"   type="reset" >清空</button>

        </form>
      </div>
      <xblock style='height:30px;'>
       {$str}
        <span class="x-right" style="line-height:40px">共有数据：{$count} 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
            <th>
              <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
            </th>
            <th>小区ID</th>
            <th>小区名称</th>
            <th>是否在总团长中</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
        <volist name="list" id="vo">
          <tr>
            <td>
              <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id={$vo['id']}><i class="layui-icon">&#xe605;</i></div>
            </td>
            <td>{$vo['id']}</td>
            <td>{$vo['name']}</td>
            <td>
 				<php>
				if($vo['is_flag']==1){
					echo '<font color="red">否</font>';
				}else{
					if(in_array($vo['id'],$allow_xiaoqu_ids)){
						echo '<font color="green">是[在当前总团长下]</font>';
					}else{
						echo '<font color="green">是[在其它总团长下]</font>';
					}
				}		
				</php>           	
			</td>
            <td class="td-manage">
 				<php>
 				if($vo['is_flag']==1){
 				</php>
 				<span   class="layui-btn  layui-btn-xs layui-btn-normal " onclick="AllStatus(this,'{$vo['id']}','{$pid}','{:U('addzongtaunzhangxiaoqu')}')">添加</span>
 				<php>	
 				}else{
					if(in_array($vo['id'],$allow_xiaoqu_ids)){
					</php>
						<span   class="layui-btn  layui-btn-xs layui-btn-normal " onclick="AllStatus(this,'{$vo['id']}','{$pid}','{:U('canelzongtaunzhangxiaoqu')}')">删除</span>
					<php>
					}
				}	
				</php>             
				

            </td>
          </tr>
        </volist>


        </tbody>
      </table>
      <div class="page" id="page">
        {$page}
      </div>

    </div>
    <script>

      layui.use('laydate', function(){
        var laydate = layui.laydate;
        
        //执行一个laydate实例
        laydate.render({
          elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
          elem: '#end' //指定元素
        });
      });

       /*用户-停用*/
      function member_stop(obj,id){
          layer.confirm('确认要停用吗？',function(index){

              if($(obj).attr('title')=='启用'){

                //发异步把用户状态进行更改
                $(obj).attr('title','停用')
                $(obj).find('i').html('&#xe62f;');

                $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用');
                layer.msg('已停用!',{icon: 5,time:1000});

              }else{
                $(obj).attr('title','启用')
                $(obj).find('i').html('&#xe601;');

                $(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用');
                layer.msg('已启用!',{icon: 5,time:1000});
              }
              
          });
      }





    </script>

<include file="Public/footer"/>

